package edu.gyc.objecthomework;

public class Dog
{
	private String name;
	private String breed;
	private int age;

	// Accessors and Mutators
	public void setName(String newName)
	{
		name = newName;
	}
	public String getName()
	{
		return name;
	}
	public void setBreed(String newBreed)
	{
		breed = newBreed;
	}
	public String getBreed()
	{
		return breed;
	}
	public void setAge(int newAge)
	{
		age = newAge;
	}
	public int getAge()
	{
		return age;
	}

	// Equals method
	public boolean equals(Dog otherDog)
	{
		return (breed.equals(otherDog.breed) &&
			    name.equals(otherDog.name) &&
			    age == otherDog.age);
	}

	public void writeOutput()
	{
		System.out.println("Name: " + name);
		System.out.println("Breed: " + breed);
		System.out.println("Age in calendar years: " + age);
		System.out.println("Age in human years: " + getAgeInHumanYears());
		System.out.println();
	}

	public int getAgeInHumanYears()
	{
		int humanYears = 0;
		if (age <= 2)
		{
			humanYears = age * 11;
		}
		else
		{
			humanYears = 22 + ((age-2) * 5);
		}
		return humanYears;
	}
}